<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page import="com.kaisheng.util.IntervalUtil" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>项目管理系统</title>
	<link rel="stylesheet" href="static/css/bootstrap.min.css"/>
	<style type="text/css">
		body{
			background-image:url(static/img/bg.png);
		}
	</style>
	<script type="text/javascript" src="http://api.map.baidu.com/api?key=1c9e87d6e503e41335c10add50a2d4ff&v=1.0&services=false" ></script> 
 
</head>
<body>
	<div class="body">
		<div class="navbar navbar-fixed-top">
			<div class="navbar-inner">
				<div class="container">
					<a class="brand"href="">Kaishengit PMS</a>
				</div>
			</div>
		</div>
		<div class="container" style="margin-top:60px">
			<div class="row">
				<div class="span3">
					<div  style="padding:15px">
						<ul class="nav nav-list">
							<li class="nav-header" style="font-size:14px">${sessionScope.userProject.project.name }</li>
							<li class="divider">&nbsp;</li>
							<li><a href="project.jspx"><i class="icon-home"></i>最新动态</a></li>
							<li><a href="goal.jspx"><i class="icon-flag"></i>目标</a></li>
							<li><a href="document.jspx"><i class="icon-folder-open"></i>资料库</a></li>
							<li><a href="files.jspx"><i class="icon-file"></i>文件共享</a></li>
							<li class="active"><a href="contact.jspx"><i class="icon-white icon-user"></i>联系人</a></li>
							<li><a href="idea.jspx"><i class="icon-fire"></i>想法</a></li>
							<li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>
							<li><a href="set.jspx"><i class="icon-cog"></i>项目设置</a></li>
						</ul>
					</div>
				</div>
				<div class="span9">
					<ul class="breadcrumb" style="margin-bottom:0px">
						<li class="active">
							<a href=""><i class="icon-user"></i>联系人</a>
						</li>
					</ul>
					
					<div style="margin-left:10px;border-top:none">
					
							<address>
					
							 <h3>${contact.name}</h3> 
							<p>${contact.company}</p>
							<small>手机&nbsp;&nbsp;${contact.cellphone }</small><br />
							<small>固话&nbsp;&nbsp;${contact.phone}</small><br /><br />
							<small>邮箱&nbsp;&nbsp;${contact.email}</small><br />
							<small>地址&nbsp;&nbsp;${contact.address }</small><br /><br />
							<small>主页&nbsp;&nbsp;${contact.homepage }</small><br />
							<small>微博&nbsp;&nbsp;${contact.weibo }</small><br /><br />		
								
							</address>
		
			经度：<input  value="${jingdu }"  style = "width:100px" id="jingdu" />	
			纬度:<input  value="${weidu }" style = "width:100px" id="weidu" />			
				
				<div style="width:300px;height:300px;border:1px solid gray; padding:5px 0 0 0; " id="container"></div>
						
						<h4>记录</h4><hr />
						
						<form action="contact.jspx?m=note&id=${contact.id }" method = "post" id = "myform">
							<textarea class="span5" rows="3" name ="textarea"></textarea><br />
							<button type = "button" class = "btn primary-btn" id = "btnSave">发布</button>
						</form>
						
						
					<c:forEach items = "${cuList}" var = "cu">
					<c:set value="${cu.createtime }" var="time"></c:set>
								<%String time = (String)pageContext.getAttribute("time"); %>
								<div style="border:4px,0,2px,2px; solid #ddd;">
													<div class="row">
														<div class="span1" style = "padding-bottom:5px">			
								
																<img alt="" src="contact.jspx?m=showImg&img=${cu.user.pic }">
														</div>
														<div class = "span3">
														
															<blockquote>
															 ${cu.event }
															  <small>${cu.user.name }发布于<%=IntervalUtil.getInterval(time) %>
															  <a href="contact.jspx?m=editevent&id=${cu.id}&contactid=${cu.contact.id}" title="编辑"><i class="icon-pencil"></i></a>
													    	  <a href="contact.jspx?m=delnote&id=${cu.id}&contactid=${cu.contact.id}" title="删除"><i class="icon-trash"></i></a>
															  </small>
															</blockquote>
														</div>
													
													</div>
					
					</c:forEach>
						
						
						<a href="contact.jspx">←返回联系人列表</a>
					</div>
				
				
				
				</div>
			</div>
		
		</div>
		
		
	</div>
	<script type = "text/javascript" src = "static/js/jquery.js"></script>
	<script type = "text/javascript">
		$(document).ready(function(){
			$("#btnSave").click(function(){
				$("#myform").submit();
			
			});
		
		});
		
	
	
	</script>

	<script type = "text/javascript">
	
		
		 var map = new BMap.Map("container");  
            var point = new BMap.Point("${jingdu}"," ${weidu}");//地图的经纬度坐标（经度坐标，纬度坐标）  
              
            map.centerAndZoom(point, 17); // 初始化：point初始要定位到的点,15:地图显示级别即比例尺，值越大显示的越详细  
            map.addControl(new BMap.NavigationControl({type: BMAP_NAVIGATION_CONTROL_SMALL}));  
            var marker = new BMap.Marker(new BMap.Point("${jingdu}"," ${weidu}"));  
            map.addOverlay(marker);  
             
            marker.addEventListener("click", function(){this.openInfoWindow(infoWin);});  
             
            var infoWinOpts = {  
             width : 80,    
             height : 60
            };  
            var infoWin = new BMap.InfoWindow("<div style='text-align:left;margin-top:10px;font-size:14;color:#1A6DAF'>地址:${contact.address }<br>电话：${contact.cellphone }</div>",infoWinOpts); //点击显示文字  
            marker.openInfoWindow(infoWin);  
            map.enableScrollWheelZoom();                 //用鼠标滚轴  
	
	</script>

	
	
</body>
</html>